package com.cloud.drore.eboss.operation.controller;

import com.cloud.drore.eboos.common.base.PagePo;
import com.cloud.drore.eboos.common.base.ResultMessage;
import com.cloud.drore.eboos.common.entity.dealer.OperationRefundOrderQueryPo;
import com.cloud.drore.eboos.common.entity.dealer.OperationRefundOrderQueryVo;
import com.cloud.drore.eboos.common.entity.dealer.OrderDetailVo;
import com.cloud.drore.eboos.common.entity.dealer.RefundOrderDicVo;
import com.cloud.drore.eboos.exception.BusinessException;
import com.cloud.drore.eboss.supplier.service.IRefundOrderFeign;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.sql.ResultSet;
import java.util.List;

/**
 * 浙江卓锐科技股份有限公司 版权所有  Copyright 2018<br>
 *
 * @Description: 运营商退订订单Controller<br>
 * @Project: eboos <br>
 * @CreateDate: Created in 2018/2/9 17:09 <br>
 * @Author: <a href="747639122@qq.com">冯腾</a>
 */
@RestController
@RequestMapping("/operationRefundOrder")
@Api(value = "运营商-订单管理-退订订单接口" , description = "运营商-订单管理-退订订单接口-冯腾")
public class OperationRefundOrderController {

    public ResultSet get(ResultSet resultSet){
        return null;
    }

    @Autowired
    IRefundOrderFeign refundOrderFeign;

    @ApiOperation(value = "运营商条件查询退订订单")
    @PostMapping(value = "operationQueryRefundOrder")
    public ResultMessage<List<OperationRefundOrderQueryVo>> operationQueryRefundOrder(@RequestBody PagePo<OperationRefundOrderQueryPo> pagePo) throws BusinessException {
        return refundOrderFeign.operationQueryRefundOrder(pagePo);
    }

    @ApiOperation(value = "运营商退订订单详情")
    @GetMapping(value = "getOrderDetail/{id}/{productType}")
    public ResultMessage<OrderDetailVo> getOrderDetail(@PathVariable("id") Long id, @PathVariable("productType") String productType) throws BusinessException {
        return refundOrderFeign.get(id,productType);
    }

    @ApiOperation(value = "运营商退订订单页面加载初始化信息")
    @GetMapping(value = "/operationInit")
    public ResultMessage<RefundOrderDicVo> operationInit(){
        return refundOrderFeign.operationInit();
    }

}
